#ifndef _MACHINE_STAT_H
#define _MACHINE_STAT_H

#include "r_cg_macrodriver.h"
#include "key_process.h"
#include "soft_time.h"
#include "r_cg_port.h"

typedef  struct {
	uint8_t sec;
	uint8_t min;
	uint8_t hour;
	uint8_t day;
	uint8_t mouth;
	uint8_t year;  
}DATE_STAT;
extern DATE_STAT date_stat;
extern uint8_t dis_remember;
/*
typedef enum{
	OFFLINE,
	ONLINE,//1
}NET_Stat ;

typedef enum{
    SMARTLINK_FAILED ,
    SMARTLINK_SUCCESS,//1
}SMARTLINK_Stat;

typedef enum{
    NO_SIGNAL,	
    LOW,
    MID,
    HIGH,
}SIGNAL_Stat;

typedef struct{
	NET_Stat       net_stat;
	SMARTLINK_Stat smart_link_stat;
	SIGNAL_Stat    signal;
}WIFI_Stat;
*/

#define STA_0      0
#define STA_1      1
#define STA_2      2
#define STA_3      3

#define STA_FIRE_0  0
#define STA_FIRE_1  1

#define WIFI_RESET    P6_bit.no2  

/*
 	DIGITAL_CODE_A,  //0
    DIGITAL_CODE_b,  //1
    DIGITAL_CODE_C,  //2
    DIGITAL_CODE_d,  //3
    DIGITAL_CODE_E,  //4
    DIGITAL_CODE_F,  //5
    DIGITAL_CODE_g,  //6
    DIGITAL_CODE_H,  //7
    DIGITAL_CODE_S,  //8
    DIGITAL_CODE_P,  //9 
    DIGITAL_CODE_L,  //10
    DIGITAL_CODE_n,  //11
    DIGITAL_CODE_T,  //12
    DIGITAL_CODE_K,  //13
    DIGITAL_CODE_g   //14
*/
#define Rinnai_number_version 1   
#define Rinnai_letter_version 0
typedef enum{

    MODE_INIT,//0
    MODE_STANDBY,//1
    MODE_POWEROFF,//2
    MODE_RUN,
    MODE_ERR,
    MODE_FACTORY_TEST,
    MODE_COMM_ERR,
	MODE_WIFI,
	MODE_VERSION,
	
	
	MODE_TEST = 0XFF,
    
}Machine_Stat ;

extern Machine_Stat MachineStat;

typedef struct{
	uint8_t  Send_SetHeatTemp;
	uint8_t  SetHeatTemp;
	uint8_t  err_code_h;
	uint8_t  err_code_l;
	uint8_t  err_code_l_h;
	uint8_t  err_code_l_l;
	uint8_t  err_type;
	uint8_t  fire_stat; //
	uint8_t  power_stat;
	uint8_t  eco_stat;
	uint8_t  eco_mode;
	uint8_t  SetHeatTempMax;
	uint8_t  SetHeatTempMin;
	//add
	uint8_t  akey_cycle;
	uint8_t  cycle_mode;
//	uint8_t  cycle_book;
	uint8_t  super_mode;
	uint8_t  cold_stat;
	uint8_t  running_mode;

	//send
	//uint8_t  send_eco_mode;
	uint8_t  send_akeycycle;
	uint8_t  send_cycle_mode;
//	uint8_t  send_cycle_book;
	uint8_t  send_super_mode;
	uint8_t  send_cold_stat;
	uint8_t  send_running_mode;

}HEATER_INFO;

extern HEATER_INFO heater_info;
extern Time wifitime;
extern uint8_t smartlink_start;

//heater_info.shower_temp=0;






void machine_stat(void);






#endif